<template>
  <div>
<h3>登录页面</h3>
<p>账号：<input type="text" v-model="username"></p>
<p>密码：<input type="text" v-model="password"></p>
<p><button @click="login">登录</button></p>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {
            username:'',
            password:'',
        }
    },
    methods: {
        login() {
            let fdata=new FormData()
            fdata.append('username',this.username)
            fdata.append('password',this.password)
            axios({
                url:'http://127.0.0.1:8000/app01/login/',
                method:'post',
                data:fdata
            }).then(resp=>{
                console.log(resp.data)
            })
        }
    }
}
</script>

<style>

</style>